package com.TrainingCenter.dao.impl;

import com.TrainingCenter.dao.Dao;
import com.TrainingCenter.entity.Persitent;
import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;

/**
 * Created with IntelliJ IDEA.
 * User: ibook
 * Date: 07.05.14
 * Time: 15:02
 * To change this template use File | Settings | File Templates.
 */
public abstract class AbstractHibernateDao<T extends Persitent> implements Dao<T> {

   private SessionFactory sessionFactory;


    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;}

    protected Session getSession() {
        return sessionFactory.getCurrentSession();
    }
}
